package cn.com.nes.site.module.service.analysis;

import java.sql.Connection;
import java.sql.SQLException;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.com.nes.common.util.DBUtils;
import cn.com.nes.site.entity.DataReq;
import cn.com.nes.site.entity.PageData;
import cn.com.nes.site.module.dao.analysis.AppAnalysisDaoImpl;

@Service
public class AppAnalysisService {

    @Resource
    private AppAnalysisDaoImpl impl;
    
	public PageData getAppHomeData(DataReq req) throws SQLException  {
		Connection conn = null ;
		PageData res = new PageData() ;
		try {
			conn =DBUtils.getJNDIDBConn() ;
			res = impl.getAppHomeData(conn,req);
		}catch (Exception e) {
		}finally {
			if(conn!=null) {
				conn.rollback();
				conn.close();
			} 
		}
		return res ;
		
	}
	
	public PageData getOpeMapData(DataReq req) throws SQLException  {
		Connection conn = null ;
		PageData res = new PageData() ;
		try {
			conn =DBUtils.getJNDIDBConn() ;
			res = impl.getOpeMapData(conn,req);
		}catch (Exception e) {
		}finally {
			if(conn!=null) {
				conn.rollback();
				conn.close();
			} 
		}
		return res ;
		
	}
	
	public PageData getNewParameters(DataReq req) throws SQLException  {
		Connection conn = null ;
		PageData res = new PageData() ;
		try {
			conn =DBUtils.getJNDIDBConn() ;
			res = impl.getNewParameters(conn,req);
		}catch (Exception e) {
			e.printStackTrace();
		}finally {
			if(conn!=null) {
				conn.rollback();
				conn.close();
			} 
		}
		return res ;
		
	}
    
 
}
